{"ast":null,"code":"import HolderOutlined from \"@ant-design/icons/es/icons/HolderOutlined\";\nimport classNames from 'classnames';\nimport RcTree from 'rc-tree';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport initCollapseMotion from '../_util/motion';\nimport dropIndicatorRender from './utils/dropIndicator';\nimport renderSwitcherIcon from './utils/iconUtil';\nimport useStyle from './style';\nconst Tree = /*#__PURE__*/React.forwardRef((props, ref) => {\n  const {\n    getPrefixCls,\n    direction,\n    virtual\n  } = React.useContext(ConfigContext);\n  const {\n    prefixCls: customizePrefixCls,\n    className,\n    showIcon = false,\n    showLine,\n    switcherIcon,\n    blockNode = false,\n    children,\n    checkable = false,\n    selectable = true,\n    draggable,\n    motion: customMotion\n  } = props;\n  const prefixCls = getPrefixCls('tree', customizePrefixCls);\n  const rootPrefixCls = getPrefixCls();\n  const motion = customMotion !== null && customMotion !== void 0 ? customMotion : Object.assign(Object.assign({}, initCollapseMotion(rootPrefixCls)), {\n    motionAppear: false\n  });\n  const newProps = Object.assign(Object.assign({}, props), {\n    checkable,\n    selectable,\n    showIcon,\n    motion,\n    blockNode,\n    showLine: Boolean(showLine),\n    dropIndicatorRender\n  });\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const draggableConfig = React.useMemo(() => {\n    if (!draggable) {\n      return false;\n    }\n    let mergedDraggable = {};\n    switch (typeof draggable) {\n      case 'function':\n        mergedDraggable.nodeDraggable = draggable;\n        break;\n      case 'object':\n        mergedDraggable = Object.assign({}, draggable);\n        break;\n      default:\n        break;\n      // Do nothing\n    }\n\n    if (mergedDraggable.icon !== false) {\n      mergedDraggable.icon = mergedDraggable.icon || /*#__PURE__*/React.createElement(HolderOutlined, null);\n    }\n    return mergedDraggable;\n  }, [draggable]);\n  return wrapSSR( /*#__PURE__*/React.createElement(RcTree, Object.assign({\n    itemHeight: 20,\n    ref: ref,\n    virtual: virtual\n  }, newProps, {\n    prefixCls: prefixCls,\n    className: classNames({\n      [`${prefixCls}-icon-hide`]: !showIcon,\n      [`${prefixCls}-block-node`]: blockNode,\n      [`${prefixCls}-unselectable`]: !selectable,\n      [`${prefixCls}-rtl`]: direction === 'rtl'\n    }, className, hashId),\n    direction: direction,\n    checkable: checkable ? /*#__PURE__*/React.createElement(\"span\", {\n      className: `${prefixCls}-checkbox-inner`\n    }) : checkable,\n    selectable: selectable,\n    switcherIcon: nodeProps => renderSwitcherIcon(prefixCls, switcherIcon, showLine, nodeProps),\n    draggable: draggableConfig\n  }), children));\n});\nexport default Tree;","map":{"version":3,"names":["HolderOutlined","classNames","RcTree","React","ConfigContext","initCollapseMotion","dropIndicatorRender","renderSwitcherIcon","useStyle","Tree","forwardRef","props","ref","getPrefixCls","direction","virtual","useContext","prefixCls","customizePrefixCls","className","showIcon","showLine","switcherIcon","blockNode","children","checkable","selectable","draggable","motion","customMotion","rootPrefixCls","Object","assign","motionAppear","newProps","Boolean","wrapSSR","hashId","draggableConfig","useMemo","mergedDraggable","nodeDraggable","icon","createElement","itemHeight","nodeProps"],"sources":["/data/messenger.client/node_modules/antd/es/tree/Tree.js"],"sourcesContent":["import HolderOutlined from \"@ant-design/icons/es/icons/HolderOutlined\";\nimport classNames from 'classnames';\nimport RcTree from 'rc-tree';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport initCollapseMotion from '../_util/motion';\nimport dropIndicatorRender from './utils/dropIndicator';\nimport renderSwitcherIcon from './utils/iconUtil';\nimport useStyle from './style';\nconst Tree = /*#__PURE__*/React.forwardRef((props, ref) => {\n  const {\n    getPrefixCls,\n    direction,\n    virtual\n  } = React.useContext(ConfigContext);\n  const {\n    prefixCls: customizePrefixCls,\n    className,\n    showIcon = false,\n    showLine,\n    switcherIcon,\n    blockNode = false,\n    children,\n    checkable = false,\n    selectable = true,\n    draggable,\n    motion: customMotion\n  } = props;\n  const prefixCls = getPrefixCls('tree', customizePrefixCls);\n  const rootPrefixCls = getPrefixCls();\n  const motion = customMotion !== null && customMotion !== void 0 ? customMotion : Object.assign(Object.assign({}, initCollapseMotion(rootPrefixCls)), {\n    motionAppear: false\n  });\n  const newProps = Object.assign(Object.assign({}, props), {\n    checkable,\n    selectable,\n    showIcon,\n    motion,\n    blockNode,\n    showLine: Boolean(showLine),\n    dropIndicatorRender\n  });\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const draggableConfig = React.useMemo(() => {\n    if (!draggable) {\n      return false;\n    }\n    let mergedDraggable = {};\n    switch (typeof draggable) {\n      case 'function':\n        mergedDraggable.nodeDraggable = draggable;\n        break;\n      case 'object':\n        mergedDraggable = Object.assign({}, draggable);\n        break;\n      default:\n        break;\n      // Do nothing\n    }\n\n    if (mergedDraggable.icon !== false) {\n      mergedDraggable.icon = mergedDraggable.icon || /*#__PURE__*/React.createElement(HolderOutlined, null);\n    }\n    return mergedDraggable;\n  }, [draggable]);\n  return wrapSSR( /*#__PURE__*/React.createElement(RcTree, Object.assign({\n    itemHeight: 20,\n    ref: ref,\n    virtual: virtual\n  }, newProps, {\n    prefixCls: prefixCls,\n    className: classNames({\n      [`${prefixCls}-icon-hide`]: !showIcon,\n      [`${prefixCls}-block-node`]: blockNode,\n      [`${prefixCls}-unselectable`]: !selectable,\n      [`${prefixCls}-rtl`]: direction === 'rtl'\n    }, className, hashId),\n    direction: direction,\n    checkable: checkable ? /*#__PURE__*/React.createElement(\"span\", {\n      className: `${prefixCls}-checkbox-inner`\n    }) : checkable,\n    selectable: selectable,\n    switcherIcon: nodeProps => renderSwitcherIcon(prefixCls, switcherIcon, showLine, nodeProps),\n    draggable: draggableConfig\n  }), children));\n});\nexport default Tree;"],"mappings":"AAAA,OAAOA,cAAc,MAAM,2CAA2C;AACtE,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,MAAM,MAAM,SAAS;AAC5B,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,kBAAkB,MAAM,iBAAiB;AAChD,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD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